import {Pipe, PipeTransform} from '@angular/core';
import {FormItemTypes} from '../../consts/FormElementConsts';

@Pipe({name: 'formItemTypePipe'})
export class FormItemTypePipe implements PipeTransform {

  transform(type: string) {
    const target = FormItemTypes.find(ele => ele.value === type);
    if (target) {
      return target.label;
    } else {
      return type;
    }
  }

}
